//
//  HWMyViewController.m
//  HWanGame
//
//  Created by Chendaobin on 2019/8/23.
//  Copyright © 2019年 Chendaobin. All rights reserved.
//

#import "HWMyViewController.h"
#import "HWMembersView.h"
#import "HWLiBaoView.h"
#import "HWPersonalDataViewController.h"
#import "HWMyGiftBagViewController.h"
#import "HWMyFocusViewController.h"
#import "HWCollectionViewController.h"
#import "HWMyDetailViewController.h"
#import "HWTrumpetManagementViewController.h"
#import "HWRetunTrumpetViewController.h" // 以前的小号管理界面
#import "HWSetZhongXingViewController.h"
#import "HWAccountSecurityController.h" // 账户安全
#import "HWMembersCenterViewController.h" // 会员中心
#import "HWMyAmountViewController.h" // 充值
#import "HWMyFlatViewController.h"  // 我的平台币
#import "HWLoginController.h"  // 登录界面
#import "HWCustomerServiceCenterViewController.h" // 客服中心
#import "HWIntegralSubsidiaryViewController.h" // 积分明细
#import "HWsXiaoHaoGuanLiViewController.h" // 小号管理
#import "HWMyCurrencyViewController.h" // 我的绑币
#import "HWWebViewTopUpController.h"
#import "XMGWebViewController.h"
#import "HWMyzhangdangQCViewController.h" // 游戏账单
#import "HWMowanSetTheCenterViewController.h"

#import "HWzhongxingPersonalCenterTableViewCell.h"
#import "HWSheZhiViewController.h"
#import "HWAssetsViewController.h"
#import "HWXiaoXiMessageCenterViewController.h" // 消息中心
#import "HWpinglunViewController.h" //评论
#import "HWInviteFriendsViewController.h" //邀请好友
#import "HWMyVouchersViewController.h"
#import "HWAboutUsGuanYuViewController.h" // 关于我们
// #import "HWAboutUsGuanYuViewController.h"
#import "HWXiaoHaotrumpetInterfaceViewController.h"


#import "HWIntegralMallshopViewController.h"


#import "HWyaoqinghaoyoujiemianViewController.h"


#import "HWSheZhiLanguageViewController.h"


#import "HWanGame-Swift.h"

#import <Masonry.h>





@interface HWMyViewController ()<UITableViewDelegate,UITableViewDataSource,HWLiBaoViewDelegate,HWMembersViewDelegate>
@property(strong,nonatomic) UITableView *mainaTableVie;
@property(strong,nonatomic) UIView *hederView;
@property(strong,nonatomic) UIView *blueView;
@property(strong,nonatomic) UIImageView *touxiangimageView;
@property(strong,nonatomic) UILabel *mingchenglabel;
@property(strong,nonatomic) UILabel *gerenzhongxinglabel;
@property(strong,nonatomic) NSArray *focusArray;
@property(strong,nonatomic) UIView  *commentsFuview;
@property(strong,nonatomic) HWMembersView *memberView;
@property(strong,nonatomic) HWLiBaoView *libaoView;
@property(strong,nonatomic) UIImageView *zuanimageView;
@property(strong,nonatomic) NSDictionary *userDic; //存储用户信息
@property(strong,nonatomic) NSMutableArray *guanZpinglunMuArr;
@property(strong,nonatomic) NSArray *kapianArr; // 卡片数组
@property(strong,nonatomic)NSDictionary *configDic;


// 导航uiview
@property(strong,nonatomic) UIView *daohaView;
@property(strong,nonatomic) UILabel *biatiuLabe;

@property(strong,nonatomic) UIView *hongdianView;



// 最新的代码

@property(strong,nonatomic) NSDictionary *shujuDic;
@property(strong,nonatomic) NSArray  *navArr;

@property(strong,nonatomic) UIView *tableheadView; // 这个改成了一个单独的Uiview
@property(strong,nonatomic) UIImageView *xingtouxiangImageView;
@property(strong,nonatomic) UIImageView *shezhiImageView;
@property(strong,nonatomic) UIImageView *touzhiIamgeView;
@property(strong,nonatomic) UIImageView *hentianIamge;
@property (strong,nonatomic) UIImageView *New1Imageview;
@property(strong,nonatomic) UILabel *mingchengLabel;
@property(strong,nonatomic) UIImageView *biaqinIMamge;
@property(strong,nonatomic) UIImageView *vipImageView;

@property(strong,nonatomic)UIView *kimsSecuritiesView;  
@property(strong,nonatomic)NSMutableArray *securitiesOrintegralMuArr;



@property(strong,nonatomic) UIView *zuixingheadeView;
@property(strong,nonatomic)UIView *zhangdankapianView;
@property(strong,nonatomic) NSMutableArray *imageViewMuArr;
@property(strong,nonatomic) NSMutableArray *labeMuArr;



//圈子Uivieq
@property(strong,nonatomic) UIView *remequanziUIView;
@property(strong,nonatomic) NSDictionary *quanziDic;
@property(strong,nonatomic) UIImageView *quanziImageView;
@property(strong,nonatomic) NSMutableArray  *quanziIamgeViewArr;
@property(strong,nonatomic) NSMutableArray  *quanziLabelArr;





// 我的游戏
@property(strong,nonatomic) NSDictionary *mygameDic;
@property(assign,nonatomic)  NSInteger xuanzhongTag;
@property(strong,nonatomic)  UIButton *xuanzhongBut;

@property(strong,nonatomic) NSArray *oftenPlayArr;
@property(strong,nonatomic) NSArray *appointmentArr;
@property(strong,nonatomic) NSArray *collectionArr;



@property(strong,nonatomic) HWMineVipView *mineVipView;




@end

@implementation HWMyViewController


//-(UITableView *)mainaTableVie {
//
//    if  (_mainaTableVie == nil) {
//
//        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, kScreenW, kScreenH-TabBarHeight) style:UITableViewStylePlain];
//        _mainaTableVie.delegate = self;
//        _mainaTableVie.dataSource = self;
//        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
//
//        _mainaTableVie.backgroundColor = [UIColor whiteColor];
//    }
//    return   _mainaTableVie ;
//
//}


-(UITableView *)mainaTableVie {
    
    if  (_mainaTableVie == nil) {
        
        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, kScreenW, kScreenH-TabBarHeight+StatusBarHeight) style:UITableViewStylePlain];
        _mainaTableVie.delegate = self;
        _mainaTableVie.dataSource = self;
        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
        _mainaTableVie.backgroundColor = [UIColor whiteColor];
        _mainaTableVie.backgroundColor =  RGB(247, 247, 247);
        _mainaTableVie.showsVerticalScrollIndicator = NO;
        
    }
    return   _mainaTableVie ;
    
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    //   [self chaxunUserCenter];
    //最新接口
    [self zuixingqingqiushuju];
    
    
    [self shiforcunzaixiaoxi];
    
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    
    [self.navigationController setNavigationBarHidden:NO animated:animated];
}








-(void)dealloc {
    
    [[NSNotificationCenter defaultCenter]removeObserver:self];
    
    
    
    
}



- (void)zuixingqingqiushuju {
    
    
    
    NSString *userID = [HWLocallyStoredData getLoginUserID];
    NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:sign];
    NSDictionary *parametes = @{
        @"ct" :  @"app2022",
        @"ac" : @"account",
        @"ios" : @"1",
        @"uid" :userID,
        @"t" :tStr,
        @"member_id":[HWLocallyStoredData getCode],
        @"sign": signMD5
    };
    
    
    
    //    [MBProgressHUD show:@"正在绑定邮箱"];
    
    [HWWebUtils do3GetWithParameters:parametes progress:nil success:^(id response) {
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        //   [MBProgressHUD hideHUD];
        
        
        if ([codeStr intValue] == 1) {
            
            self.configDic =  response[@"data"][@"config"];
            
            
            self.mingchengLabel.text = [NSString stringWithFormat:@"%@",response[@"data"][@"user"][@"user_name"]];
//            [HWLocallyStoredData setUserName:response[@"data"][@"user"][@"user_name"]];
//            [HWLocallyStoredData setUserFace:response[@"data"][@"user"][@"face"]];
            [self.New1Imageview sd_setImageWithURL:[NSURL URLWithString:response[@"data"][@"user"][@"face"]] placeholderImage:nil];
            
            UILabel *laebe0 =    self.securitiesOrintegralMuArr[0];
            UILabel *laebe1 =    self.securitiesOrintegralMuArr[1];
            UILabel *laebe2 =    self.securitiesOrintegralMuArr[2];
            UILabel *laebe3 =    self.securitiesOrintegralMuArr[3];
            laebe0.text = [NSString stringWithFormat:@"%@",response[@"data"][@"user"][@"coupon"]];
            
            laebe1.text = [NSString stringWithFormat:@"%@",response[@"data"][@"user"][@"point"]];
            laebe2.text = [NSString stringWithFormat:@"%@",response[@"data"][@"user"][@"yuyue"]];
            laebe3.text = [NSString stringWithFormat:@"%@",response[@"data"][@"user"][@"coin"]];
            NSString  * vip_img =   response[@"data"][@"user"][@"vip_img"];
            self.vipImageView.backgroundColor = [UIColor clearColor];
            if (![vip_img isEqualToString:@""]) {
                [self.vipImageView sd_setImageWithURL:[NSURL URLWithString:vip_img] placeholderImage:nil];
                
            }
            
            
            
            
            NSString  *huiyuan_img = response[@"data"][@"user"][@"huiyuan_img"];
            self.biaqinIMamge.backgroundColor = [UIColor clearColor];
            
            if (![huiyuan_img isEqualToString:@""]) {
                [self.biaqinIMamge sd_setImageWithURL:[NSURL URLWithString:huiyuan_img] placeholderImage:nil];
                
            }
            
            
            
            NSString    *bgimg = [NSString stringWithFormat:@"%@",response[@"data"][@"config"][@"bgimg"]];
            [self.xingtouxiangImageView sd_setImageWithURL:[NSURL URLWithString:bgimg] placeholderImage:nil];
            
            NSString  *huiyuan = [NSString stringWithFormat:@"%@",response[@"data"][@"config"][@"huiyuan"]];
            
            
            //       self.hentianIamge.image = [UIImage imageNamed:@"ImmediatelyOpened"];
            if ([response[@"data"][@"config"][@"vip"] isEqualToString:@"VIP0"]) {
                self.mineVipView.hidden = YES;
                self.hentianIamge.hidden = NO;
                [self.hentianIamge sd_setImageWithURL:[NSURL URLWithString:huiyuan] placeholderImage:[UIImage imageNamed:@"ImmediatelyOpened"]];
            }else{
                self.mineVipView.hidden = NO;
                self.hentianIamge.hidden = YES;
                [self.mineVipView.bgImageView sd_setImageWithURL:[NSURL URLWithString:huiyuan] placeholderImage:[UIImage imageNamed:@"ImmediatelyOpened"]];
                CGFloat lastExp = [response[@"data"][@"config"][@"last_exp"] floatValue];
                CGFloat exp = [response[@"data"][@"config"][@"exp"] floatValue];
                self.mineVipView.surplusLabel.text = [NSString stringWithFormat:@"当前VIP值：%@，距离下一级剩余:%@", response[@"data"][@"config"][@"exp"],response[@"data"][@"config"][@"last_exp"]];
//                self.mineVipView.progressBar.progress = exp/lastExp;
                NSLog(@"%lf",exp/lastExp);
            }
            
            //  self.hentianIamge.hidden = YES;
            
//            self.upgradeSurplusLabel.text = "VIP值：\(model.top.exp ?? 0)，距离下一级剩余:\((model.top.last_exp ?? 0) - (model.top.exp ?? 0))"
//            self.openTipsLabel.text = model.top.end_time
//            self.progressBar.progress = CGFloat(model.top.exp) / CGFloat(model.top.last_exp)
            
            self.shujuDic = response[@"data"];
            self.quanziDic =  response[@"data"][@"quanzi"];
            self.mygameDic =  response[@"data"][@"mygame"];
            
            if ([self.mygameDic[@"lists"] count ] > 0 ) {
                self.oftenPlayArr = self.mygameDic[@"lists"][0][@"list"];
                self.appointmentArr =  self.mygameDic[@"lists"][1][@"list"];
                self.collectionArr =  self.mygameDic[@"lists"][2][@"list"];
            }
            //                 self.oftenPlayArr = self.mygameDic[@"lists"][0][@"list"];
            //                 self.appointmentArr =  self.mygameDic[@"lists"][1][@"list"];
            //                 self.collectionArr =  self.mygameDic[@"lists"][2][@"list"];
            //
            
            
            [self kapianshujutianji];
            //圈子界面
            [self shuxingquanziView];
            
            
            
            
            
            
            
            
            [self.mainaTableVie reloadData];
            
            
        }else if ([codeStr intValue] == 100) {
            
            [self chongxingdenglushuxing];
            
            
        }else {
            
            [MBProgressHUD  showSuccess:response[@"message"]];
            
        }
        NSLog(@"%@",response);
        
        
    } failure:^(NSString *error) {
        
        [MBProgressHUD  showError:@"查询失败"];
        
        
    }];
    
    // 17801317358
    
}


// 重新登录  token 时间太久了
- (void)chongxingdenglushuxing  {
    
    [HWLocallyStoredData setUserID:@""];
    
    [self zuixingqingqiushuju];
    
    
}






- (void)kapianshujutianji {
    
    
    NSArray *arr  =  self.shujuDic[@"nav"];
    self.navArr =  self.shujuDic[@"nav"];
    
    
    [self.zhangdankapianView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    
    
    
    CGFloat hengjianju = (kScreenW - 40-4*54)/5;
    CGFloat  shujianju =20;
    
    for (int i = 0 ; i < arr.count; i++) {
        int row = i/4;
        int line = i%4;
        
        
        NSDictionary *dic = arr[i];
        
        UIView *beijingview = [[UIView alloc]initWithFrame:CGRectMake(line*54+hengjianju*(line+1), shujianju*row+shujianju+row*41, 54, 20+17+4)];
        beijingview.backgroundColor = [UIColor clearColor];
        beijingview.userInteractionEnabled = YES;
        [self.zhangdankapianView addSubview:beijingview];
        
        beijingview.tag = i;
        UITapGestureRecognizer *beijingGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(beijingTap:)];
        [beijingview addGestureRecognizer:beijingGesture];
        
        
        
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake((54-20)/2, 0, 20, 20)];
        // imageView.image = [UIImage imageNamed:self.icoArr[i]];
        //   imageView.userInteractionEnabled = YES;
        [beijingview addSubview:imageView];
        imageView.tag = i;
        [self.imageViewMuArr addObject:imageView];
        
        [imageView sd_setImageWithURL:[NSURL URLWithString:dic[@"icon"]] placeholderImage:nil];
        
        
        
        UILabel *shulianlabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 24, 54, 17)];
        shulianlabel.textColor =RGB(51, 51, 51);
        //  shulianlabel.text = self.listArr[i];
        //  shulianlabel.backgroundColor = [UIColor orangeColor];
        shulianlabel.font = [UIFont systemFontOfSize:12];
        shulianlabel.textAlignment = NSTextAlignmentCenter;
        [beijingview addSubview:shulianlabel];
        [self.labeMuArr addObject:shulianlabel];
        
        
        shulianlabel.text = dic[@"name"];
        
        
        
        
        
    }
    
    
    
    
    NSInteger  row =  (arr.count-1)/4;
    self.zhangdankapianView.frame = CGRectMake( 20 , 10,  kScreenW -40, shujianju*row+shujianju+row*41+20 + 41);
    
    // 第一个卡片  10+2*41+60
    self.tableheadView.frame =  CGRectMake(0, 0, kScreenW, 218+StatusBarHeight+30+20 + 10+shujianju*row+shujianju+row*41+20 + 41 +10 +14*1+14+1*71+14+26+71+14+10);
    
    //  self.tableheadView.backgroundColor = [UIColor redColor];
    self.mainaTableVie.tableHeaderView =  self.tableheadView;
    
    
    
    
    
    
    
    
    
    
    
}






- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"个人中心";
    
    
    self.navigationItem.title =  [HWjianzhiduiObject keylocalization:@"个人中心"];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshTableView:) name:@"cenderSentimentOnTheSlide" object:nil];
    
    
    
    //这些暂时没有用上
    
    
    // 设置常用属性
    //    [self setUpCommonlyAttribute];
    //    [self setUpUI];
    //    // 余额  平台比
    //    [self addMembersOrBalance];
    //    [self addLibaoView];
    
    //
    [self latestSetUI];
    
    //  [self navigaView];
    
    
    //    UIView *genhuview = [[UIView alloc]initWithFrame:CGRectMake(200, 100, 50, 50)];
    //
    //    UITapGestureRecognizer *genhuatap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(genhuantap)];
    //    [genhuview addGestureRecognizer:genhuatap];
    //    genhuview.backgroundColor = [UIColor redColor];
    //
    //    [self.view addSubview:genhuview];
    
    
}

- (void)genhuantap {
    
    HWSheZhiLanguageViewController *langguan = [[HWSheZhiLanguageViewController alloc]init];
    [self.navigationController pushViewController:langguan animated:YES];
    
}






- (void)refreshTableView:(NSNotification *)noti {
    
    NSLog(@"%@",noti.userInfo);
    
    
    NSDictionary *dic = noti.userInfo;
    NSString *str  = [NSString stringWithFormat:@"%@",dic[@"rolling"]];
    int  a = [str intValue];
    self.xuanzhongTag = a;
    [self.mainaTableVie reloadData];
    
    
    
}





- (void)navigaView  {
    
    //    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    //    button.frame = CGRectMake(10,StatusBarHeight+17, 40, 17);
    //    [button setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
    //    [button addTarget:self action:@selector(buttonTap) forControlEvents:UIControlEventTouchUpInside];
    //
    //    [self.view addSubview:button];
    //
    //    UILabel *textlabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-70)/2, StatusBarHeight+17, 70, 17)];
    //    textlabel.text = @"游戏详情";
    //    textlabel.textAlignment =  NSTextAlignmentCenter;
    //    textlabel.textColor = [UIColor whiteColor];
    //    textlabel.font = [UIFont systemFontOfSize:16];
    //    [self.view addSubview:textlabel];
    
    
    UIView *backeview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 44+StatusBarHeight+5)];
    backeview.backgroundColor = [UIColor whiteColor];
    self.daohaView = backeview;
    
    //   backeview.alpha = 0.1;
    [self.view addSubview:backeview];
    
    //    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    //    button.frame = CGRectMake(10,StatusBarHeight+17, 40, 17);
    //    [button setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
    //    [button addTarget:self action:@selector(buttonTap) forControlEvents:UIControlEventTouchUpInside];
    //    self.fanhuiBut = button;
    //    [self.view  addSubview:button];
    
    UILabel *textlabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-70)/2, StatusBarHeight+17, 70, 17)];
    //    textlabel.text = @"个人中心";
    textlabel.textAlignment =  NSTextAlignmentCenter;
    textlabel.textColor = [UIColor whiteColor];
    textlabel.textColor = RGB(68, 68, 68);
    textlabel.font = [UIFont systemFontOfSize:16];
    self.biatiuLabe  = textlabel;
    textlabel.hidden = YES;
    self.biatiuLabe.text = [HWjianzhiduiObject keylocalization:@"个人中心"];
    
    [self.view  addSubview:textlabel];
    
    
    
}





- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    
    NSLog(@"变化 %f ---- %f",scrollView.contentOffset.x,scrollView.contentOffset.y);
    
    if (scrollView.contentOffset.y  > 200 ) {
        
        self.daohaView.hidden = NO;
        self.biatiuLabe.textColor = RGB(68, 68, 68);
        
        //     [self.fanhuiBut setImage:[UIImage imageNamed:@"detailshei_back"] forState:UIControlStateNormal];
        
        [self.navigationController setNavigationBarHidden:NO];
        
        
    } else if (scrollView.contentOffset.y  < 60) {
        
        
        
        self.daohaView.hidden = YES;
        
        //   [self.fanhuiBut setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
        self.biatiuLabe.textColor = RGB(68, 68, 68);
        [self.navigationController setNavigationBarHidden:YES];
        
        
        
    }
    
    
}









// 设置 背景颜色
- (void)latestSetUI {
    
    [self.view addSubview:self.mainaTableVie];
    
    [self zuixingaddheadeView];
    //添加headeview的空间
    [self addheadeViewkongjian];
    
    [self addtabviewheadeview];
    
    
    
    
    UIView  *footview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 15)];
    footview.backgroundColor = RGB(247, 247, 247);
    
    
    
    
    UIView *baiseview  = [[UIView alloc]initWithFrame:CGRectMake(20, 0, kScreenW- 40, 10)];
    baiseview.backgroundColor =  [UIColor whiteColor];
    
    [footview addSubview:baiseview];
    
    
    self.mainaTableVie.tableFooterView = footview;
    
    
}


- (void)zuixingaddheadeView  {
    
    //  self.mainaTableVie.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
    // 第一个卡片  10+2*41+60。   第二个 卡片 10 +14*1+14+1*71+14+26+71+14
    self.tableheadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, 218+StatusBarHeight+30+20 + 10+2*41+60 +10 +14*1+14+1*71+14+26+71+14+10)];
    //    self.tableheadView.backgroundColor = [UIColor redColor];
    self.mainaTableVie.tableHeaderView = self.tableheadView;
    self.tableheadView.backgroundColor = RGB(247, 247, 247);
    
    //  [self.view addSubview:self.tableheadView];
    
    
    
    
    
    
    
}



// 添加tableviewHeade
- (void)addtabviewheadeview {
    
    // [UIColor redColor]
    
    self.zuixingheadeView = [[UIView alloc] initWithFrame:CGRectMake(0 , self.xingtouxiangImageView.bottom+20 , kScreenW, 10+2*41+60+10 +14*1+14+1*71+14+26+71+14)];
    
    self.zuixingheadeView.backgroundColor = RGB(247, 247, 247);
    //   self.mainaTableVie.tableHeaderView = self.zuixingheadeView;
    //self.zuixingheadeView.backgroundColor = [UIColor yellowColor];
    [self.tableheadView addSubview:self.zuixingheadeView];
    [self addheaderViewkongjian];
    
    // 热门圈子
    [self renmenquanziView];
    
    
}




- (void)addheaderViewkongjian  {
    
    
    self.zhangdankapianView = [[UIView alloc]initWithFrame:CGRectMake(20, 10, kScreenW -40, 142)];
    self.zhangdankapianView.backgroundColor =  [UIColor whiteColor];
    self.zhangdankapianView.layer.cornerRadius = 10;
    self.zhangdankapianView.layer.masksToBounds  = YES;
    [self.zuixingheadeView addSubview:self.zhangdankapianView];
    
    
    self.imageViewMuArr = [[NSMutableArray alloc]init];
    self.labeMuArr = [[NSMutableArray alloc]init];
    self.zhangdankapianView.frame = CGRectMake( 20 , 10,  kScreenW -40, 2*41+60);
    
    
    
    
    
    
    
    
    
}







- (void)beijingTap:(UITapGestureRecognizer *)sender {
    
    
    UIView *imageView = (UIView *)sender.view;
    NSInteger tag = imageView.tag;
    NSDictionary *dic =self.navArr[tag];
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    // 315
    
    //    NSString *urlStr = dic[@"url"];
    //
    //      if (![urlStr isEqualToString:@""]) {
    //
    //
    //            XMGWebViewController *webVc = [[XMGWebViewController alloc] init];
    //            webVc.url = [NSURL URLWithString:urlStr];
    //            [self.navigationController pushViewController:webVc animated:YES];
    //
    //          return;
    //      }
    
    NSString *type = dic[@"type"];
    
    
    if ([type isEqualToString:@"301"]) {
        
        HWMyGiftBagViewController *MyGiftBag = [[HWMyGiftBagViewController alloc]init];
        [self.navigationController pushViewController:MyGiftBag animated:YES];
        
        
    }else if ([type isEqualToString:@"302"]) {
        
        HWMyzhangdangQCViewController *IntegralSubsidiary = [[HWMyzhangdangQCViewController alloc]init];
        [self.navigationController pushViewController:IntegralSubsidiary animated:YES];
        
        
    }
    else if ([type isEqualToString:@"303"]) {
        
        // 角色管理"
        
        //        HWsXiaoHaoGuanLiViewController *xiaoHao = [[HWsXiaoHaoGuanLiViewController alloc]init];
        //       [self.navigationController pushViewController:xiaoHao animated:YES];
        
        
        HWXiaoHaotrumpetInterfaceViewController *xiaohao = [[HWXiaoHaotrumpetInterfaceViewController alloc]init];
        [self.navigationController pushViewController:xiaohao animated:YES];
        
        
        
        
        
    }
    else if ([type isEqualToString:@"304"]) {
        
        //   我的收藏
        HWCollectionViewController *CollectionView =[[HWCollectionViewController alloc]init];
        [self.navigationController pushViewController:CollectionView animated:YES];
        
        
    }
    else if ([type isEqualToString:@"305"]) {
        
        //    我的绑币
        HWMyCurrencyViewController *bangbi = [[HWMyCurrencyViewController alloc]init];
        [self.navigationController pushViewController:bangbi animated:YES];
        
        
    }else if ([type isEqualToString:@"306"]) {
        
        
        
        // 设置中心
        
        HWSetZhongXingViewController *setZhongXing  = [[HWSetZhongXingViewController alloc]init];
        [self.navigationController pushViewController:setZhongXing animated:YES];
        
    }else if ([type isEqualToString:@"307"]) {
        //     客服中心
        
        
    }else if ([type isEqualToString:@"308"]) {
        //    帐号安全
        
        HWAccountSecurityController *acount  = [[HWAccountSecurityController alloc]init];
        [self.navigationController pushViewController:acount animated:YES];
        
        
        
    } else if ( [type isEqualToString:@"315"]) {
        
        HWAssetsViewController *assts = [[HWAssetsViewController alloc]init];
        [self.navigationController pushViewController:assts animated:YES];
        
        
    } else if ([type isEqualToString:@"317"]) {
        
        
        HWpinglunViewController *pinglun = [[HWpinglunViewController alloc]init];
        [self.navigationController pushViewController:pinglun animated:YES];
        
        
    } else if([type isEqualToString:@"313"]) {
        
        //         HWInviteFriendsViewController *invite = [[HWInviteFriendsViewController alloc]init];
        //         [self.navigationController pushViewController:invite animated:YES];
        
        
        HWyaoqinghaoyoujiemianViewController *yaoqing = [[HWyaoqinghaoyoujiemianViewController alloc]init];
        [self.navigationController pushViewController:yaoqing animated:YES];
        
        return;
        
        
    } else if ([type isEqualToString:@"318"]) {
        
        HWAboutUsGuanYuViewController *abou =  [[HWAboutUsGuanYuViewController alloc]init];
        [self.navigationController pushViewController:abou animated:YES];
        
        
    }else if ([type isEqualToString:@"316"]){
        HWOpenVipController *openVipController = [[HWOpenVipController alloc] init];
        [self.navigationController pushViewController:openVipController animated:YES];
        
    }else if ([type isEqualToString:@"334"]){
        HWVipCenterController *vipCenter = [[HWVipCenterController alloc] init];
        [self.navigationController pushViewController:vipCenter animated:YES];
    }else {
        NSString *urlStr = dic[@"url"];
        
        if (![urlStr isEqualToString:@""]) {
            
            
            XMGWebViewController *webVc = [[XMGWebViewController alloc] init];
            webVc.url = [NSURL URLWithString:urlStr];
            [self.navigationController pushViewController:webVc animated:YES];
            
            return;
        }
        
    }
    
    
    
    
    
    
    
    
}




-  (void)QCgerenzhongXingTaP {
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    HWPersonalDataViewController *personData = [[HWPersonalDataViewController alloc]init];
    [self.navigationController pushViewController:personData animated:YES];
    
    
}






//热门圈子
- (void)renmenquanziView  {
    
    
    // redview
    
    self.remequanziUIView = [[UIView alloc] initWithFrame:CGRectMake(20, self.zhangdankapianView.bottom+10, kScreenW-40, 231)];
    self.remequanziUIView.backgroundColor = [UIColor whiteColor];
    self.remequanziUIView.layer.cornerRadius = 10;
    self.remequanziUIView.layer.masksToBounds = YES;
    [self.zuixingheadeView addSubview:self.remequanziUIView];
    
    // [UIColor redColor]
    self.quanziImageView = [[UIImageView alloc] initWithFrame:CGRectMake(12, 14, 84, 26)];
    self.quanziImageView.backgroundColor = [UIColor clearColor];
    [self.remequanziUIView addSubview:self.quanziImageView];
    
    
    //    self.quanziIamgeViewArr  = [[NSMutableArray alloc]init];
    //    self.quanziLabelArr = [[NSMutableArray alloc]init];
    //
    //
    //
    //       CGFloat hengjianju = (kScreenW - 40-4*54)/8;
    //       CGFloat  shujianju =14;
    //
    //         for (int i = 0 ; i < 8; i++) {
    //                 int row = i/4;
    //                 int line = i%4;
    //
    //
    //                 UIView *beijingview = [[UIView alloc]initWithFrame:CGRectMake(line*54+hengjianju*(line*2)+hengjianju, shujianju*row+shujianju+row*71+14+26, 54, 71)];
    //                 beijingview.backgroundColor = [UIColor redColor];
    //                 [self.remequanziUIView addSubview:beijingview];
    //
    //                 beijingview.tag = i;
    //                 UITapGestureRecognizer *beijingGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(quzidic:)];
    //                 [beijingview addGestureRecognizer:beijingGesture];
    //
    //
    //
    //
    //                 UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(1, 0, 52, 52)];
    //                // imageView.image = [UIImage imageNamed:self.icoArr[i]];
    //              //   imageView.userInteractionEnabled = YES;
    //                 [beijingview addSubview:imageView];
    //                 imageView.tag = i;
    //               imageView.layer.masksToBounds = YES;
    //                imageView.layer.cornerRadius = 10;
    //               [self.quanziIamgeViewArr addObject:imageView];
    //
    //
    //
    ////                 [imageView sd_setImageWithURL:[NSURL URLWithString:dic[@"icon"]] placeholderImage:nil];
    //
    //
    //
    //                 UILabel *shulianlabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 52+5, 54, 14)];
    //                 shulianlabel.textColor =RGB(51, 51, 51);
    //               //  shulianlabel.text = self.listArr[i];
    //                      //  shulianlabel.backgroundColor = [UIColor orangeColor];
    //                 shulianlabel.font = [UIFont systemFontOfSize:12];
    //                 shulianlabel.textAlignment = NSTextAlignmentCenter;
    //                 [beijingview addSubview:shulianlabel];
    //
    //             [self.quanziLabelArr addObject:shulianlabel];
    //
    //
    //
    //
    //
    //
    //
    //
    //
    //             }
    //
    //
    //
    
    
    
    
    
    
    
    
    
    
    
    
}





- (void)shuxingquanziView  {
    
    NSArray *listsArr =  self.quanziDic[@"lists"];
    
    
    
    [self.remequanziUIView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    
    [self.remequanziUIView addSubview:self.quanziImageView];
    
    
    
    
    [self.quanziImageView  sd_setImageWithURL:[NSURL URLWithString:self.quanziDic[@"icon"]] placeholderImage:nil];
    
    
    self.quanziIamgeViewArr  = [[NSMutableArray alloc]init];
    self.quanziLabelArr = [[NSMutableArray alloc]init];
    
    
    
    CGFloat hengjianju = (kScreenW - 40-4*58)/8;
    CGFloat  shujianju =14;
    
    for (int i = 0 ; i < listsArr.count; i++) {
        int row = i/4;
        int line = i%4;
        
        NSDictionary *dic = listsArr[i];
        
        
        
        UIView *beijingview = [[UIView alloc]initWithFrame:CGRectMake(line*58+hengjianju*(line*2)+hengjianju, shujianju*row+shujianju+row*71+14+26, 58, 71)];
        beijingview.backgroundColor = [UIColor clearColor];
        [self.remequanziUIView addSubview:beijingview];
        
        beijingview.tag = i;
        UITapGestureRecognizer *beijingGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(quzidic:)];
        [beijingview addGestureRecognizer:beijingGesture];
        
        
        
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(3, 0, 52, 52)];
        // imageView.image = [UIImage imageNamed:self.icoArr[i]];
        //   imageView.userInteractionEnabled = YES;
        [beijingview addSubview:imageView];
        imageView.tag = i;
        imageView.layer.masksToBounds = YES;
        imageView.layer.cornerRadius = 10;
        [self.quanziIamgeViewArr addObject:imageView];
        
        [imageView sd_setImageWithURL:[NSURL URLWithString:dic[@"icon"]]placeholderImage:nil];
        
        
        
        
        //                 [imageView sd_setImageWithURL:[NSURL URLWithString:dic[@"icon"]] placeholderImage:nil];
        
        
        
        UILabel *shulianlabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 52+5, 58, 14)];
        shulianlabel.textColor =RGB(136, 136, 136);
        //  shulianlabel.text = self.listArr[i];
        //  shulianlabel.backgroundColor = [UIColor orangeColor];
        shulianlabel.font = [UIFont systemFontOfSize:10];
        shulianlabel.textAlignment = NSTextAlignmentCenter;
        [beijingview addSubview:shulianlabel];
        
        shulianlabel.text = [NSString stringWithFormat:@"%@",dic[@"name"]];
        
        
        [self.quanziLabelArr addObject:shulianlabel];
        
    }
    
    
    //    NSInteger  row = ((listsArr.count - 1)/4);
    
    
    
    NSInteger  row  = 0;
    if (listsArr.count > 0 ) {
        row = ((listsArr.count - 1)/4);
    }
    
    
    
    
    self.remequanziUIView.frame =     CGRectMake(20, self.zhangdankapianView.bottom+10, kScreenW-40, shujianju*row+shujianju+row*71+14+26+71+14);
    
    
    self.zuixingheadeView.height = self.zhangdankapianView.bottom+10 + shujianju*row+shujianju+row*71+14+26+71+14;
    
    
    
}








- (void)quzidic:(UITapGestureRecognizer *)sender  {
    
    
    
    UIView *imageView = (UIView *)sender.view;
    NSInteger tag = imageView.tag;
    
    NSArray  *quziArr  = self.quanziDic[@"lists"];
    
    
    NSDictionary *dic = quziArr[tag];
    
    
    HWGameDetailController *game = [[HWGameDetailController alloc]init];
    game.gameId= dic[@"id"];
    [self.navigationController  pushViewController:game animated:YES];
    
    
    
    
    
    
}












// 给头部添加控件
- (void)addheadeViewkongjian {
    
    
    self.xingtouxiangImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0,kScreenW , 218+StatusBarHeight+30)];
    self.xingtouxiangImageView.image = [UIImage imageNamed:@"beijingyanse"];
    
    self.xingtouxiangImageView.userInteractionEnabled = YES;
    [self.tableheadView addSubview:self.xingtouxiangImageView];
    
    
    self.hentianIamge = [[UIImageView alloc] initWithFrame:CGRectMake(15*CFLScaleValue, (self.xingtouxiangImageView.bottom-40*CFLScaleValue),360*CFLScaleValue - 15*CFLScaleValue, 66*CFLScaleValue)];
    self.hentianIamge.image = [UIImage imageNamed:@"ImmediatelyOpened"];
    self.hentianIamge.backgroundColor = [UIColor clearColor];
    self.hentianIamge.userInteractionEnabled = YES;
    [self.tableheadView addSubview:self.hentianIamge];
    
    
    UITapGestureRecognizer *hengtiaotap  =  [[UITapGestureRecognizer  alloc] initWithTarget:self action:@selector(hengtiaotapshezhi)];
    
    [self.hentianIamge addGestureRecognizer:hengtiaotap];
    
    self.mineVipView = [[HWMineVipView alloc] init];
    [self.tableheadView addSubview:self.mineVipView];
    
    [self.mineVipView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.centerY.mas_equalTo(self.hentianIamge);
        
    }];
    
    
    self.shezhiImageView  =  [[UIImageView alloc]initWithFrame:CGRectMake(kScreenW - 20 -20 -15-20, StatusBarHeight+20, 20, 20)];
    self.shezhiImageView.image = [UIImage imageNamed:@"shezhi_ico"];
    self.shezhiImageView.userInteractionEnabled = YES;
    [self.xingtouxiangImageView  addSubview:self.shezhiImageView];
    UITapGestureRecognizer *sehzhitap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(shezhiImageViewTap)];
    
    [self.shezhiImageView addGestureRecognizer:sehzhitap ];
    
    
    
    
    
    //  self.mingchengLabel
    
    
    
    
    self.touzhiIamgeView  =  [[UIImageView alloc]initWithFrame:CGRectMake(kScreenW - 20 -20, StatusBarHeight+20, 20, 20)];
    self.touzhiIamgeView.image = [UIImage imageNamed:@"xiaoxi_ico"];
    self.touzhiIamgeView.userInteractionEnabled = YES;
    [self.xingtouxiangImageView  addSubview:self.touzhiIamgeView];
    
    UITapGestureRecognizer  *tongzhitap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(touzhiIamgeViewTap)];
    
    [self.touzhiIamgeView  addGestureRecognizer:tongzhitap];
    
    
    self.hongdianView = [[UIView alloc]initWithFrame:CGRectMake(14, 0, 6, 6)];
    self.hongdianView.backgroundColor = [UIColor redColor];
    self.hongdianView.layer.cornerRadius = 3;
    self.hongdianView.layer.masksToBounds = YES;
    self.hongdianView.hidden = YES;
    
    [self.touzhiIamgeView addSubview:self.hongdianView];
    
    
    
    
    
    self.New1Imageview  =  [[UIImageView alloc]initWithFrame:CGRectMake(12, StatusBarHeight+20+40, 66, 66)];
    // self.newIcoiamgeView.image = [UIImage imageNamed:@"xiaoxi_ico"];
    self.New1Imageview.userInteractionEnabled = YES;
    self.New1Imageview.layer.cornerRadius =10;
    self.New1Imageview.layer.masksToBounds = YES;
    self.New1Imageview.backgroundColor = [UIColor clearColor];
    self.New1Imageview.userInteractionEnabled =YES;
    
    [self.xingtouxiangImageView  addSubview:self.New1Imageview];
    
    
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(QCgerenzhongXingTaP)];
    [self.New1Imageview addGestureRecognizer:tap1];
    //   self QCgerenzhongXingTaP
    
    
    
    
    UILabel *netLabel = [[UILabel alloc]initWithFrame:CGRectMake( self.New1Imageview.right+10 , StatusBarHeight+20+40, kScreenW-200, 22)];
    netLabel.textColor  = [UIColor whiteColor];
    netLabel.text = @"游戏名称";
    netLabel.font = [UIFont systemFontOfSize:16];
    self.mingchengLabel = netLabel;
    [self.xingtouxiangImageView  addSubview:netLabel];
    
    
    
    
    self.biaqinIMamge  = [[UIImageView alloc]initWithFrame:CGRectMake(self.New1Imageview.right+10 , self.mingchengLabel.bottom+10, 12, 12)];
    self.biaqinIMamge.backgroundColor = [UIColor yellowColor];
    [self.xingtouxiangImageView addSubview:self.biaqinIMamge];
    
    
    
    
    
    self.vipImageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.biaqinIMamge.right+10, self.mingchengLabel.bottom+10+1, 49, 10)];
    self.vipImageView.backgroundColor =  [UIColor redColor];
    [self.xingtouxiangImageView addSubview:self.vipImageView];
    
    
    
    
    
    self.kimsSecuritiesView = [[UIView alloc]initWithFrame:CGRectMake(0, self.New1Imageview.bottom+20, kScreenW, 28+1+17)];
    self.kimsSecuritiesView.backgroundColor = [UIColor clearColor];
    [self.xingtouxiangImageView  addSubview:self.kimsSecuritiesView];
    
    
    
    NSArray *dataArra = @[@"5",@"5",@"5",@"20.00"];
    //  NSArray *cunchuLabelMuArr1 =  @[@"代金券",@"积分",@"预约",@"平台币"];
    
    NSArray *cunchuLabelMuArr1 =  @[[HWjianzhiduiObject keylocalization:@"代金券"],[HWjianzhiduiObject keylocalization:@"积分"],[HWjianzhiduiObject keylocalization:@"预约"],[HWjianzhiduiObject keylocalization:@"平台币"]];
    
    
    self.securitiesOrintegralMuArr  = [[NSMutableArray alloc]init];
    
    
    //    CGFloat jianju = (kScreenW -50 - 3*80)/4;
    
    
    
    CGFloat jianju = (kScreenW -50)/4;
    
    
    for (int i = 0; i < dataArra.count; i++) {
        
        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(jianju+jianju*i+80*i, 10, 80, 28+1+17)];
        view.backgroundColor = [UIColor clearColor];
        
        view.frame = CGRectMake(jianju*i+ 10 + 10*i , 0, jianju,  28+1+17);
        view.tag = i;
        
        [self.kimsSecuritiesView addSubview:view];
        
        
        
        
        UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dianjxuanzhong:)];
        
        [view addGestureRecognizer:tap1];
        
        
        
        
        
        UILabel *shulianlabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, jianju, 28)];
        shulianlabel.textColor =RGB(102, 102, 102);
        shulianlabel.textColor = RGB(255, 255, 255);
        
        shulianlabel.text = dataArra[i];
        //  shulianlabel.backgroundColor = [UIColor orangeColor];
        shulianlabel.font = [UIFont systemFontOfSize:18];
        shulianlabel.textAlignment = NSTextAlignmentCenter;
        [view addSubview:shulianlabel];
        [self.securitiesOrintegralMuArr addObject:shulianlabel];
        
        
        
        
        
        
        
        
        
        UILabel *jingeLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 28+1, jianju, 17)];
        jingeLabel.textColor =RGB(255, 255, 255);
        jingeLabel.text =  cunchuLabelMuArr1[i];
        //  shulianlabel.backgroundColor = [UIColor orangeColor];
        jingeLabel.font = [UIFont systemFontOfSize:12];
        jingeLabel.textAlignment = NSTextAlignmentCenter;
        [view addSubview:jingeLabel];
        
        
        
        
        
    }
    
    
    
    
    
    
    
    
    
}























- (void)setUpCommonlyAttribute {
    
    self.focusArray = @[@"关注",@"评论",@"发圈",@"粉丝"];
    
    //  我的积分   平台币  我的绑币
    
    
}






// 设置UI
- (void)setUpUI {
    
    
    [self.view addSubview:self.mainaTableVie];
    UIView *hederview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 600)];
    //   hederview.backgroundColor  = [UIColor redColor];
    self.hederView = hederview;
    self.mainaTableVie.tableHeaderView = hederview;
    //蓝色背景Uiview
    [self setupblueView];
    
    
}

//  设置蓝色背景Uivieqw
- (void)setupblueView {
    
    self.blueView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 219+StatusBarHeight+30)];
    self.blueView.backgroundColor = [UIColor orangeColor];
    [self.hederView addSubview:self.blueView];
    
    UIImageView *imagView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 219+StatusBarHeight+30)];
    imagView.userInteractionEnabled = YES;
    UIImage *lashengimge  = [UIImage imageNamed:@"personal_bg1"];
    // UIImage *zuizhonimge  =  [lashengimge resizableImageWithCapInsets:UIEdgeInsetsMake(lashengimge.size.height*0.9, lashengimge.size.width*0.9, lashengimge.size.height*0.9, lashengimge.size.width*0.9)];
    imagView.image = lashengimge;
    
    
    imagView.userInteractionEnabled = YES;
    [self.blueView addSubview:imagView];
    
    UIButton *messagesBut = [UIButton buttonWithType:UIButtonTypeCustom];
    [messagesBut setBackgroundImage:[UIImage imageNamed:@"personal_messages"] forState:UIControlStateNormal];
    [messagesBut addTarget:self action:@selector(messagesTap) forControlEvents:UIControlEventTouchUpInside];
    messagesBut.frame = CGRectMake(kScreenW-15-21, StatusBarHeight+7, 21, 16);
    messagesBut.hidden = YES;
    [self.blueView addSubview:messagesBut];
    
    self.touxiangimageView = [[UIImageView alloc]initWithFrame:CGRectMake(17, 30+StatusBarHeight, 60,60)];
    //    self.touxiangimageView.image = [UIImage imageNamed:@"personal_bg"];
    // self.touxiangimageView.backgroundColor = [UIColor redColor];
    self.touxiangimageView.image = [UIImage imageNamed:@"morenTuPenson_ico"];
    self.touxiangimageView.layer.cornerRadius  = 29;
    self.touxiangimageView.layer.masksToBounds = YES;
    self.touxiangimageView.userInteractionEnabled = YES;
    self.touxiangimageView.layer.borderWidth = 2;
    self.touxiangimageView.layer.borderColor = RGB(178, 208, 255).CGColor;
    
    UITapGestureRecognizer *tapic11 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(gerenzhongXingTaP)];
    [self.touxiangimageView addGestureRecognizer:tapic11];
    [self.blueView addSubview:self.touxiangimageView];
    
    self.mingchenglabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.touxiangimageView.right+13, self.touxiangimageView.top+10+3, 40, 12)];
    self.mingchenglabel.text = @"未登录";
    self.mingchenglabel.font = [UIFont systemFontOfSize:12];
    self.mingchenglabel.textColor = [UIColor whiteColor];
    //   self.mingchenglabel.backgroundColor = [UIColor redColor];
    [self.blueView addSubview:self.mingchenglabel];
    
    UIImageView *zuanimageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.mingchenglabel.right+6, self.touxiangimageView.top+10+3, 16, 14)];
    zuanimageView.image = [UIImage imageNamed:@"personal_vip"];
    self.zuanimageView = zuanimageView;
    [self.blueView addSubview:zuanimageView];
    
    
    
    
    
    self.gerenzhongxinglabel = [[UILabel alloc]initWithFrame:CGRectMake(self.touxiangimageView.right+13, self.mingchenglabel.bottom+5, 70, 16)];
    self.gerenzhongxinglabel.textColor = [UIColor whiteColor];
    self.gerenzhongxinglabel.text = @"个人中心";
    self.gerenzhongxinglabel.font = [UIFont systemFontOfSize:10];
    //  self.gerenzhongxinglabel.backgroundColor = RGB(54, 141, 255);
    self.gerenzhongxinglabel.layer.cornerRadius = 8;
    self.gerenzhongxinglabel.layer.masksToBounds = YES;
    self.gerenzhongxinglabel.textAlignment =  NSTextAlignmentCenter;
    // self.gerenzhongxinglabel.alpha = 0.1;
    self.gerenzhongxinglabel.userInteractionEnabled = YES;
    
    self.gerenzhongxinglabel.backgroundColor = QCchunseshensetupian;
    
    [self.blueView addSubview: self.gerenzhongxinglabel];
    
    UITapGestureRecognizer *gerenzhongtap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(gerenzhongXingTaP)];
    [self.gerenzhongxinglabel addGestureRecognizer:gerenzhongtap];
    
    // 这个是关注 评论 等和 数字 的Uiview
    UIView *commentsFuview = [[UIView alloc]initWithFrame:CGRectMake(15,  self.touxiangimageView.bottom+16, kScreenW-30, 34)];
    self.commentsFuview = commentsFuview;
    commentsFuview.hidden = YES;
    // commentsFuview.backgroundColor = [UIColor redColor];
    [self.blueView addSubview:commentsFuview];
    
    CGFloat kuandu = commentsFuview.frame.size.width/4;
    self.guanZpinglunMuArr = [[NSMutableArray alloc]init];
    
    for (int i = 0; i < self.focusArray.count; i++) {
        
        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(i*kuandu, 0, kuandu, 34)];
        
        [commentsFuview addSubview:view];
        
        UILabel *shulianlabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, kuandu, 13)];
        shulianlabel.textColor = [UIColor whiteColor];
        shulianlabel.text = @"0";
        //  shulianlabel.backgroundColor = [UIColor orangeColor];
        shulianlabel.font = [UIFont systemFontOfSize:13];
        shulianlabel.textAlignment = NSTextAlignmentCenter;
        [self.guanZpinglunMuArr addObject:shulianlabel];
        [view addSubview:shulianlabel];
        
        
        
        
        
        UILabel *guanzhulabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 21, kuandu, 13)];
        guanzhulabel.textColor = [UIColor whiteColor];
        guanzhulabel.text = self.focusArray[i];
        //  guanzhulabel.backgroundColor = [UIColor orangeColor];
        guanzhulabel.font = [UIFont systemFontOfSize:12];
        guanzhulabel.textAlignment = NSTextAlignmentCenter;
        [view addSubview:guanzhulabel];
        
        if (i != 0 ) {
            UIView *fengexiaView = [[UIView alloc]initWithFrame:CGRectMake(i*kuandu, 9, 1, 15)];
            fengexiaView.backgroundColor = [UIColor whiteColor];
            [commentsFuview addSubview:fengexiaView];
            
        }
        
        
        
        
    }
    
    
    
    
    
    
    
}


// 添加会员 余额  平台币
- (void)addMembersOrBalance {
    
    self.memberView  = [[HWMembersView alloc]initWithFrame:CGRectMake(15,self.commentsFuview.bottom+10, kScreenW-30, 100)];
    self.memberView.backgroundColor = [UIColor whiteColor];
    self.memberView.layer.shadowColor = [UIColor colorWithRed:113/255.0 green:152/255.0 blue:255/255.0 alpha:0.49].CGColor;
    self.memberView.layer.shadowOffset = CGSizeMake(0,0);
    self.memberView.layer.shadowOpacity = 1;
    self.memberView.layer.shadowRadius = 12;
    self.memberView.layer.cornerRadius = 12;
    self.memberView.layer.masksToBounds = YES;
    self.memberView.clipsToBounds = NO;
    self.memberView.delegate = self;
    [self.hederView addSubview: self.memberView];
    
    
    
    
    
}



-(void)addLibaoView {
    
    self.libaoView  = [[HWLiBaoView alloc]initWithFrame:CGRectMake(15,self.memberView.bottom+18, kScreenW-30, 166)];
    self.libaoView.backgroundColor = [UIColor whiteColor];
    self.libaoView.layer.shadowColor = [UIColor colorWithRed:113/255.0 green:152/255.0 blue:255/255.0 alpha:0.49].CGColor;
    self.libaoView.layer.shadowOffset = CGSizeMake(0,0);
    self.libaoView.layer.shadowOpacity = 1;
    self.libaoView.layer.shadowRadius = 12;
    self.libaoView.layer.cornerRadius = 12;
    self.libaoView.layer.masksToBounds = YES;
    self.libaoView.delegate = self;
    self.libaoView.clipsToBounds = NO;
    [self.hederView addSubview:self.libaoView];
    
}









#pragma mark ------ UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return  1;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    //  UITableViewCell *cell = [[UITableViewCell alloc]init];
    static NSString *cellID = @"cellID";
    HWzhongxingPersonalCenterTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[HWzhongxingPersonalCenterTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        
    }
    
    cell.selectionStyle =  UITableViewCellSelectionStyleNone;
    
    //    @property(strong,nonatomic) NSArray *oftenPlayArr;
    //    @property(strong,nonatomic) NSArray *appointmentArr;
    //    @property(strong,nonatomic) NSArray *collectionArr;
    
    
    cell.data1Arr =  self.oftenPlayArr;
    cell.data2Arr = self.appointmentArr;
    cell.data3Arr = self.collectionArr;
    cell.xuanzhongTag = self.xuanzhongTag;
    
    
    
    
    
    
    [cell shuxiangCell];
    
    
    
    return  cell;
}




- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    if (self.xuanzhongTag == 0 ) {
        if (self.oftenPlayArr.count >  0 ) {
            
            return  self.oftenPlayArr.count *62;
            
            
        } else {
            
            return  100 ;
            
            
        }
    } else if (self.xuanzhongTag == 1 ) {
        
        if (self.appointmentArr.count >  0 ) {
            
            return  self.appointmentArr.count *62;
            
            
        } else {
            
            
            return  100 ;
            
        }
        
        
    } else {
        
        
        if (self.collectionArr.count >  0 ) {
            
            
            
            return  self.collectionArr.count *62;
            
            
            
        } else {
            
            return  100 ;
            
            
        }
        
        
    }
    
    
    
    return  62*10;
    
    
    
}

- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, 14+26+14+25+2+3)];
    view.backgroundColor = RGB(247, 247, 247);
    
    
    UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(20, 0, kScreenW -40, 14+26+14+25+2+3)];
    
    view1.backgroundColor = [UIColor whiteColor];
    //    view1.layer.cornerRadius = 10;
    //    view1.layer.masksToBounds = YES;
    //
    [view addSubview:view1];
    
    NSURL *url = [NSURL URLWithString:self.mygameDic[@"icon"]];
    
    UIImageView *iamgevie  = [[UIImageView alloc]initWithFrame:CGRectMake(12, 14, 84, 26)];
    [iamgevie sd_setImageWithURL:url placeholderImage:nil];
    [view1 addSubview:iamgevie];
    
    UIView *beijinbgView = [[UIView alloc]initWithFrame:CGRectMake(0, 14+26+14+25+2, 14+26+14+25+2, 3)];
    beijinbgView.backgroundColor = RGB(255, 182, 10);
    beijinbgView.hidden = YES;
    
    
    [view1 addSubview:beijinbgView];
    
    
    
    //   NSArray *array = @[@"经常玩",@"已预约",@"已收藏"];
    
    NSArray *array = @[[HWjianzhiduiObject keylocalization:@"经常玩"],[HWjianzhiduiObject keylocalization:@"已预约"],[HWjianzhiduiObject keylocalization:@"已收藏"]];
    
    
    
    
    NSArray *arr1 =    self.mygameDic[@"lists"];
    
    CGFloat jiaju =40;
    for (int i = 0; i < arr1.count; i++) {
        UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.tag = i;
        
        [button setTitle:array[i] forState:UIControlStateNormal];
        button.frame  = CGRectMake(12+i*60 + i*jiaju , 14+26+14, 60, 25);
        button.titleLabel.font  = [UIFont systemFontOfSize:17];
        button.backgroundColor = [UIColor clearColor];
        button.layer.cornerRadius = 6;
        button.layer.masksToBounds = YES;
        //  [button setTitle:array[i] forState:UIControlStateNormal];
        
        NSString *str =  self.mygameDic[@"lists"][i][@"name"];
        [button setTitle:str forState:UIControlStateNormal];
        
        // button.titleLabel.textColor = RGB(50, 50, 50);
        [button setTitleColor:RGB(68, 68, 68) forState:UIControlStateNormal];
        [view1 addSubview:button];
        
        [button addTarget:self action:@selector(selectedTap:) forControlEvents:UIControlEventTouchUpInside];
        [button setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
        
        
        if (i == self.xuanzhongTag) {
            [button setTitleColor:RGB(68, 68, 68) forState:UIControlStateNormal];
            //   [button setBackgroundImage:[UIImage imageNamed:@"QCxuanzhong"] forState:UIControlStateNormal];
            
            //    button.backgroundColor =  QCchunseshensetupian;
            self.xuanzhongBut = button;
            
            beijinbgView.frame = CGRectMake(12+i*60+3+i*jiaju, 14+26+14+25+2, 54, 3);
            beijinbgView.hidden = NO;
            
            
            //                   if (i != 0) {
            //                        beijinbgView.frame = CGRectMake(12+i*54+3+3+(i)*3+i*jiaju, 14+26+14+25+2, 54, 3);
            //                   }
            
        }
        
        
        
        
        
        
    }
    
    
    
    
    
    
    
    return  view;
    
    
    
    
}


- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    
    
    return 14+25+14+25+2+3;
    
    
    
    
}



//选中的
- (void)selectedTap:(UIButton *)sender  {
    
    
    //    [self.xuanzhongBut setTitleColor:RGB(50, 50, 50) forState:UIControlStateNormal];
    //      [self.xuanzhongBut setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
    //
    
    self.xuanzhongBut = sender;
    
    self.xuanzhongTag = (int)sender.tag;
    
    
    
    NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0];
    NSArray *arr = @[index];
    
    // [self.mainaTableVie reloadRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationNone];
    
    
    [self.mainaTableVie reloadData];
    
    
    
    
    
}




#pragma  mark ----- 一些点击操作


// 点击右上脚个人中心
- (void)messagesTap {
    
    DLog(@"11111");
    
    
}


#pragma mark -----------  点击个人中心
-  (void)gerenzhongXingTaP {
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    HWPersonalDataViewController *personData = [[HWPersonalDataViewController alloc]init];
    [self.navigationController pushViewController:personData animated:YES];
    
    
}


// 用户中心
- (void)chaxunUserCenter {
    
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        
        //        HWLoginController *login = [[HWLoginController alloc]init];
        //        [self.navigationController pushViewController:login animated:YES];
        [self weidengluqingqiu];
        
        return ;
        
    }
    
    NSString *userID = [HWLocallyStoredData getLoginUserID];
    NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:sign];
    
    NSDictionary *parametes = @{
        @"ct" :  @"app2022",
        @"ac" : @"account",
        @"ios" : @"1",
        @"uid" :userID,
        @"t" :tStr,
        @"sign": signMD5
    };
    
    
    
    
    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        //   [MBProgressHUD hideHUD];
        
        
        if ([codeStr intValue] == 1) {
            
            //  self.fenleiMuArr = [response[@"data"] mutableCopy];
            //  [MBProgressHUD  showError:@"加载失败"];
            self.userDic = response[@"data"][@"user"];
            
            NSURL *url = [NSURL URLWithString: self.userDic[@"face"]];
            [self.touxiangimageView sd_setImageWithURL:url placeholderImage:nil];
            
            
            NSString  *pet_name = self.userDic[@"pet_name"];
            
            CGSize size  =   [WMUtil getWidthByString:pet_name withFont:[UIFont systemFontOfSize:12]  withStringSize:CGSizeMake(1000, 1000)];
            
            
            
            self.mingchenglabel.frame =  CGRectMake(self.touxiangimageView.right+13, self.touxiangimageView.top+10+3, size.width, 12);
            self.mingchenglabel.text = pet_name;
            
            // self.zuanimageView
            
            NSURL *url1 = [NSURL URLWithString:self.userDic[@"vip"]];
            self.zuanimageView.frame =    CGRectMake(self.mingchenglabel.right+6, self.touxiangimageView.top+10+3, 16, 14);
            [self.zuanimageView sd_setImageWithURL:url1 placeholderImage:nil];
            
            NSArray *guanzxhu = @[self.userDic[@"guanzhu"],self.userDic[@"pinglun"],self.userDic[@"faquan"],self.userDic[@"fans"]];
            
            for (int i = 0 ; i < self.guanZpinglunMuArr.count; i++) {
                
                UILabel *labe  = self.guanZpinglunMuArr[i];
                labe.text = [NSString stringWithFormat:@"%@",guanzxhu[i]];
                
            }
            
            self.memberView.dataDic = self.userDic;
            self.kapianArr = response[@"data"][@"nav"];
            
            self.libaoView.dataArr =  self.kapianArr;
            
            
            
            
        } else {
            
            [MBProgressHUD  showError:@"加载失败"];
            
        }
        NSLog(@"%@",response);
        
        
    } failure:^(NSString *error) {
        
        [MBProgressHUD  showError:@"加载失败"];
        
    }];
    
    
    
}




// 未登录请求
- (void)weidengluqingqiu {
    
    
    
    NSString *userID = [HWLocallyStoredData getLoginUserID];
    NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
    
    
    NSString *signMD5 = [WMUtil md5HexDigest:sign];
    
    
    
    
    NSDictionary *parametes = @{
        @"ct" :  @"app",
        @"ac" : @"account",
        @"ios" : @"1",
        @"t" :tStr
    };
    
    
    
    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        //   [MBProgressHUD hideHUD];
        
        
        if ([codeStr intValue] == 1) {
            
            //  self.fenleiMuArr = [response[@"data"] mutableCopy];
            //  [MBProgressHUD  showError:@"加载失败"];
            //                self.userDic = response[@"data"][@"user"];
            //
            //                NSURL *url = [NSURL URLWithString: self.userDic[@"face"]];
            //                [self.touxiangimageView sd_setImageWithURL:url placeholderImage:nil];
            //
            //
            //                NSString  *pet_name = self.userDic[@"pet_name"];
            //
            //                 CGSize size  =   [WMUtil getWidthByString:pet_name withFont:[UIFont systemFontOfSize:12]  withStringSize:CGSizeMake(1000, 1000)];
            //
            //
            //
            //                self.mingchenglabel.frame =  CGRectMake(self.touxiangimageView.right+13, self.touxiangimageView.top+10+3, size.width, 12);
            //                self.mingchenglabel.text = pet_name;
            //
            //                // self.zuanimageView
            //
            //                 NSURL *url1 = [NSURL URLWithString:self.userDic[@"vip"]];
            //                 self.zuanimageView.frame =    CGRectMake(self.mingchenglabel.right+6, self.touxiangimageView.top+10+3, 16, 14);
            //                 [self.zuanimageView sd_setImageWithURL:url1 placeholderImage:nil];
            //
            //                NSArray *guanzxhu = @[self.userDic[@"guanzhu"],self.userDic[@"pinglun"],self.userDic[@"faquan"],self.userDic[@"fans"]];
            //
            //                for (int i = 0 ; i < self.guanZpinglunMuArr.count; i++) {
            //
            //                    UILabel *labe  = self.guanZpinglunMuArr[i];
            //                    labe.text = [NSString stringWithFormat:@"%@",guanzxhu[i]];
            //
            //                }
            
            //                self.memberView.dataDic = self.userDic;
            //
            self.memberView.weidengluoArr = @[@"0.00",@"0.00",@"0.00"];
            
            self.mingchenglabel.text = @"未登录";
            self.touxiangimageView.image = [UIImage imageNamed:@"acat"];
            
            
            
            
            
            self.kapianArr = response[@"data"][@"nav"];
            
            self.libaoView.dataArr =  self.kapianArr;
            
            
            
            
        } else {
            
            [MBProgressHUD  showError:@"加载失败"];
            
        }
        NSLog(@"%@",response);
        
        
    } failure:^(NSString *error) {
        
        [MBProgressHUD  showError:@"加载失败"];
        
    }];
    
    
    
    
    
}







#pragma mark ------------ 礼包中的东西

- (void)xuanzhongDic:(NSDictionary *)xuanzhng {
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    
    NSString *urlStr = xuanzhng[@"url"];
    
    if (![urlStr isEqualToString:@""]) {
        XMGWebViewController *webVc = [[XMGWebViewController alloc] init];
        webVc.url = [NSURL URLWithString:urlStr];
        [self.navigationController pushViewController:webVc animated:YES];
        
        return;
    }
    
    
    
    
    
    NSString *str = xuanzhng[@"name"];
    if ([str isEqualToString:@"我的礼包"]) {
        
        HWMyGiftBagViewController *MyGiftBag = [[HWMyGiftBagViewController alloc]init];
        [self.navigationController pushViewController:MyGiftBag animated:YES];
        
    } else if ([str isEqualToString:@"我的收藏"]) {
        
        HWCollectionViewController *CollectionView =[[HWCollectionViewController alloc]init];
        [self.navigationController pushViewController:CollectionView animated:YES];
        
        
    } else if ([str isEqualToString:@"我的帐单"]) {
        
        //        HWMyDetailViewController  *detail = [[HWMyDetailViewController alloc]init];
        //        [self.navigationController pushViewController:detail animated:YES];
        
        //        HWIntegralSubsidiaryViewController *IntegralSubsidiary = [[HWIntegralSubsidiaryViewController alloc]init];
        //        [self.navigationController pushViewController:IntegralSubsidiary animated:YES];
        //
        // HWMyzhangdangQCViewController
        
        HWMyzhangdangQCViewController *IntegralSubsidiary = [[HWMyzhangdangQCViewController alloc]init];
        [self.navigationController pushViewController:IntegralSubsidiary animated:YES];
        
        
    }else if ([str isEqualToString:@"我的绑币"]) {
        
        
        HWMyCurrencyViewController *bangbi = [[HWMyCurrencyViewController alloc]init];
        [self.navigationController pushViewController:bangbi animated:YES];
        
        
    } else if ([str isEqualToString:@"小号管理"] ) {
        
        
        //           HWRetunTrumpetViewController  *trumpet = [[HWRetunTrumpetViewController alloc]init];
        //           [self.navigationController pushViewController:trumpet animated:YES];
        HWsXiaoHaoGuanLiViewController *xiaoHao = [[HWsXiaoHaoGuanLiViewController alloc]init];
        [self.navigationController pushViewController:xiaoHao animated:YES];
        
        
        
        
    } else if ([str isEqualToString:@"设置中心"] ) {
        
        HWSetZhongXingViewController *setZhongXing  = [[HWSetZhongXingViewController alloc]init];
        [self.navigationController pushViewController:setZhongXing animated:YES];
        
        
    } else if ([str isEqualToString:@"帐号安全"]) {
        
        HWAccountSecurityController *acount  = [[HWAccountSecurityController alloc]init];
        [self.navigationController pushViewController:acount animated:YES];
        
    } else if ([str isEqualToString:@"联系客服"]) {
        
        
        //        HWCustomerServiceCenterViewController *customerService = [[HWCustomerServiceCenterViewController alloc]init];
        //        [self.navigationController pushViewController:customerService animated:YES];
        
        
        
        
    }
    
}





-(void)xuanzhongTap:(NSInteger)tag {
    
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    if (tag == 0) {
        HWMyGiftBagViewController *MyGiftBag = [[HWMyGiftBagViewController alloc]init];
        [self.navigationController pushViewController:MyGiftBag animated:YES];
        
    } else if (tag == 1) {
        
        HWMyFocusViewController *MyFocus = [[HWMyFocusViewController  alloc]init];
        [self.navigationController pushViewController:MyFocus animated:YES];
        
        
        
    } else if (tag == 2) {
        HWCollectionViewController *CollectionView =[[HWCollectionViewController alloc]init];
        [self.navigationController pushViewController:CollectionView animated:YES];
        
        
        
        
    } else if (tag == 3) {
        
        HWMyDetailViewController  *detail = [[HWMyDetailViewController alloc]init];
        [self.navigationController pushViewController:detail animated:YES];
        
    } else if ( tag ==4) {
        
        //        HWTrumpetManagementViewController  *trumpet = [[HWTrumpetManagementViewController alloc]init];
        //        [self.navigationController pushViewController:trumpet animated:YES];
        
        //        HWRetunTrumpetViewController  *trumpet = [[HWRetunTrumpetViewController alloc]init];
        //        [self.navigationController pushViewController:trumpet animated:YES];
        
    } else if (tag == 5) {
        
        HWRetunTrumpetViewController  *trumpet = [[HWRetunTrumpetViewController alloc]init];
        [self.navigationController pushViewController:trumpet animated:YES];
        
        
    } else if (tag == 6) {
        
        HWSetZhongXingViewController *setZhongXing  = [[HWSetZhongXingViewController alloc]init];
        [self.navigationController pushViewController:setZhongXing animated:YES];
        
        
    }  else if (tag == 7) {
        
        HWAccountSecurityController *acount  = [[HWAccountSecurityController alloc]init];
        [self.navigationController pushViewController:acount animated:YES];
        
    }
    
    
    
    
    
    
    
}



#pragma mark -------- 会员中心 和 申请返利

-(void)HWMembersViewXuZhongTap:(NSInteger)tag {
    
    
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    
    if (tag == 0) {
        
        //          HWMembersCenterViewController  *members = [[HWMembersCenterViewController alloc]init];
        //         [self.navigationController pushViewController:members animated:YES];
        
        HWIntegralSubsidiaryViewController *IntegralSubsid = [[HWIntegralSubsidiaryViewController alloc]init];
        [self.navigationController pushViewController:IntegralSubsid animated:YES];
        
        
    } else if (tag == 1) {
        
        
        //          HWMyAmountViewController *MyAmount = [[HWMyAmountViewController alloc]init];
        //          [self.navigationController pushViewController:MyAmount animated:YES];
        
        HWMyCurrencyViewController *bangbi = [[HWMyCurrencyViewController alloc]init];
        [self.navigationController pushViewController:bangbi animated:YES];
        
        
        
    }else if (tag == 2) {
        //
        //          [MBProgressHUD showError:@"此功能暂未开通"];
        //          return;
        //          HWMyFlatViewController  *MyFlat = [[HWMyFlatViewController alloc]init];
        //          [self.navigationController pushViewController:MyFlat animated:YES];
        //
        HWWebViewTopUpController  *web = [[HWWebViewTopUpController alloc]init];
        [self.navigationController pushViewController:web animated:YES];
        
        
        
        
    }
    
    
    
    //   return;
    //
    //    if (tag == 0) {
    //
    //        HWMembersCenterViewController  *members = [[HWMembersCenterViewController alloc]init];
    //       [self.navigationController pushViewController:members animated:YES];
    //
    //
    //    } else if (tag == 1) {
    //
    //
    //        HWMyAmountViewController *MyAmount = [[HWMyAmountViewController alloc]init];
    //        [self.navigationController pushViewController:MyAmount animated:YES];
    //
    //
    //    }else if (tag == 2) {
    //
    //        HWMyFlatViewController  *MyFlat = [[HWMyFlatViewController alloc]init];
    //        [self.navigationController pushViewController:MyFlat animated:YES];
    //
    //
    //    }
    
    
    
}



#pragma mark ---------- 设置按钮

- (void)shezhiImageViewTap {
    
    HWSheZhiViewController *shezhi = [[HWSheZhiViewController alloc]init];
    [self.navigationController pushViewController:shezhi animated:YES];
    
    
    
    
}


- (void)touzhiIamgeViewTap {
    
    
    NSLog(@"uiiuioioio");
    
    HWXiaoXiMessageCenterViewController *xiaoxizhong = [[HWXiaoXiMessageCenterViewController alloc]init];
    [self.navigationController  pushViewController:xiaoxizhong animated:YES];
    
    
    
    
    
    
    
    
}




#pragma mark --------------  是否存在消息

- (void)shiforcunzaixiaoxi {
    
    
    
    NSString *userID = [HWLocallyStoredData getLoginUserID];
    
    
    if ([userID isEqualToString:@""]) {
        
        return;
    }
    
    
    
    
    NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:sign];
    NSDictionary *parametes = @{
        @"ct" :  @"app",
        @"ac" : @"new_message",
        @"ios" : @"1",
        @"uid" :userID,
        @"t" :tStr,
        @"member_id":[HWLocallyStoredData getCode],
        @"sign": signMD5,
        @"Version" : @"3.0",
    };
    
    
    
    //    [MBProgressHUD show:@"正在绑定邮箱"];
    
    [HWWebUtils do3GetWithParameters:parametes progress:nil success:^(id response) {
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        //   [MBProgressHUD hideHUD];
        
        
        if ([codeStr intValue] == 1) {
            
            if ([response[@"message"] isEqualToString:@"存在未读"]) {
                
                self.hongdianView.hidden = NO;
                
                
                
            } else {
                
                
                
                self.hongdianView.hidden = YES;
                
            }
            
            
            
            
            
            
        } else {
            
            //   [MBProgressHUD  showSuccess:response[@"message"]];
            
        }
        NSLog(@"%@",response);
        
        
    } failure:^(NSString *error) {
        
        [MBProgressHUD  showError:@"查询失败"];
        
        
    }];
    
    
    
    
    
    
}


#pragma mark ----------- 点击


- (void)dianjxuanzhong:(UITapGestureRecognizer *)sender  {
    
    
    UIView *view =   sender.view;
    
    NSInteger  tap =  view.tag;
    
    
    if (tap == 0 ) {
        
        HWMyVouchersViewController *myvouchers =  [[HWMyVouchersViewController alloc]init];
        [self.navigationController pushViewController:myvouchers animated:YES];
        
        
    } else if (tap == 1) {
        
        HWIntegralMallshopViewController *shangcheng = [[HWIntegralMallshopViewController alloc]init];
        [self.navigationController pushViewController:shangcheng animated:YES];
        
        
        
    } else if (tap == 2) {
        
        
        
        NSLog(@"jjjkjkjk");
        
        
    } else if (tap == 3) {
        
        NSLog(@"7888");
        
        
        HWWebViewTopUpController  *web = [[HWWebViewTopUpController alloc]init];
        [self.navigationController pushViewController:web animated:YES];
        
        
        
    }
    
    
    
    
}


//  设置hengtiaoshezhi
- (void)hengtiaotapshezhi {
    
    
    NSLog(@"hhhhhhh");
    
    //http://star.94php.com/api/app/v3/?ct=app&ac=huiyuan&app=1&token=tFEgIuqFmF6r8ORrvFAeUFgAT2/RobQp4J4tEQTk4tfmL5jgbIRLUbtmtz8XbVuy&t=1606383432&sign=6f97c6ad0c253b826683b8d4c5a197fb
    NSString *userID = [HWLocallyStoredData getLoginUserID];
    
    
    if ([userID isEqualToString:@""]) {
        
        [MBProgressHUD showError:@"请先登录"];
        return;
        
        
    }
    
    NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
    
    NSString *signMD5 = [WMUtil md5HexDigest:sign];
    
    
    
    
    NSString *urlStr = [NSString stringWithFormat:@"%@api/app/v3/?ct=app&ac=huiyuan&app=1&token=%@&t=%@&sign=%@&language=%@",[HWOCGlobalConst baseUrl],[HWLocallyStoredData getLoginUserID],tStr,signMD5,[HWjianzhiduiObject returnLanguageAcquisition]];
    
    
    NSString *huiyuan_url =  [NSString stringWithFormat:@"%@",self.configDic[@"huiyuan_url"]];
    
    XMGWebViewController *webVc = [[XMGWebViewController alloc] init];
    webVc.url = [NSURL URLWithString:huiyuan_url];
    [self.navigationController pushViewController:webVc animated:YES];
    
    
    
}





@end





#pragma mark ------------------ 以前的个人中心界面

//#import "HWMyViewController.h"
//#import "HWMembersView.h"
//#import "HWLiBaoView.h"
//#import "HWPersonalDataViewController.h"
//#import "HWMyGiftBagViewController.h"
//#import "HWMyFocusViewController.h"
//#import "HWCollectionViewController.h"
//#import "HWMyDetailViewController.h"
//#import "HWTrumpetManagementViewController.h"
//#import "HWRetunTrumpetViewController.h" // 以前的小号管理界面
//#import "HWSetZhongXingViewController.h"
//#import "HWAccountSecurityController.h" // 账户安全
//#import "HWMembersCenterViewController.h" // 会员中心
//#import "HWMyAmountViewController.h" // 充值
//#import "HWMyFlatViewController.h"  // 我的平台币
//#import "HWLoginController.h"  // 登录界面
//#import "HWCustomerServiceCenterViewController.h" // 客服中心
//#import "HWIntegralSubsidiaryViewController.h" // 积分明细
//#import "HWsXiaoHaoGuanLiViewController.h" // 小号管理
//#import "HWMyCurrencyViewController.h" // 我的绑币
//#import "HWWebViewTopUpController.h"
//#import "XMGWebViewController.h"
//#import "HWMyzhangdangQCViewController.h" // 游戏账单
//#import "HWMowanSetTheCenterViewController.h"
//
//
//
//
//
//@interface HWMyViewController ()<UITableViewDelegate,UITableViewDataSource,HWLiBaoViewDelegate,HWMembersViewDelegate>
//@property(strong,nonatomic) UITableView *mainaTableVie;
//@property(strong,nonatomic) UIView *hederView;
//@property(strong,nonatomic) UIView *blueView;
//@property(strong,nonatomic) UIImageView *touxiangimageView;
//@property(strong,nonatomic) UILabel *mingchenglabel;
//@property(strong,nonatomic) UILabel *gerenzhongxinglabel;
//@property(strong,nonatomic) NSArray *focusArray;
//@property(strong,nonatomic) UIView  *commentsFuview;
//@property(strong,nonatomic) HWMembersView *memberView;
//@property(strong,nonatomic) HWLiBaoView *libaoView;
//@property(strong,nonatomic) UIImageView *zuanimageView;
//@property(strong,nonatomic) NSDictionary *userDic; //存储用户信息
//@property(strong,nonatomic) NSMutableArray *guanZpinglunMuArr;
//@property(strong,nonatomic) NSArray *kapianArr; // 卡片数组
//
//
//
//
//
//@end
//
//@implementation HWMyViewController
//
//
//-(UITableView *)mainaTableVie {
//
//    if  (_mainaTableVie == nil) {
//
//        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, kScreenW, kScreenH-TabBarHeight) style:UITableViewStylePlain];
//        _mainaTableVie.delegate = self;
//        _mainaTableVie.dataSource = self;
//        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
//
//        _mainaTableVie.backgroundColor = [UIColor whiteColor];
//    }
//    return   _mainaTableVie ;
//
//}
//
//
//
//
//- (void)viewDidLoad {
//    [super viewDidLoad];
//
//
//    // Do any additional setup after loading the view.
//    self.view.backgroundColor = [UIColor whiteColor];
//    // 设置常用属性
//    [self setUpCommonlyAttribute];
//    [self setUpUI];
//    // 余额  平台比
//    [self addMembersOrBalance];
//    [self addLibaoView];
//
//}
//
//- (void)setUpCommonlyAttribute {
//
//    self.focusArray = @[@"关注",@"评论",@"发圈",@"粉丝"];
//
//   //  我的积分   平台币  我的绑币
//
//
//}
//
//
//
//
//- (void)viewWillAppear:(BOOL)animated {
//    [super viewWillAppear:animated];
//
//    [self chaxunUserCenter];
//    [self.navigationController setNavigationBarHidden:YES animated:animated];
//}
//
//- (void)viewWillDisappear:(BOOL)animated {
//    [super viewWillDisappear:animated];
//
//    [self.navigationController setNavigationBarHidden:NO animated:animated];
//}
//
//
//// 设置UI
//- (void)setUpUI {
//
//
//    [self.view addSubview:self.mainaTableVie];
//    UIView *hederview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 600)];
//  //   hederview.backgroundColor  = [UIColor redColor];
//    self.hederView = hederview;
//    self.mainaTableVie.tableHeaderView = hederview;
//    //蓝色背景Uiview
//    [self setupblueView];
//
//
//}
//
////  设置蓝色背景Uivieqw
//- (void)setupblueView {
//
//    self.blueView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 219+StatusBarHeight+30)];
//    self.blueView.backgroundColor = [UIColor orangeColor];
//    [self.hederView addSubview:self.blueView];
//
//    UIImageView *imagView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 219+StatusBarHeight+30)];
//    imagView.userInteractionEnabled = YES;
//    UIImage *lashengimge  = [UIImage imageNamed:@"personal_bg1"];
//   // UIImage *zuizhonimge  =  [lashengimge resizableImageWithCapInsets:UIEdgeInsetsMake(lashengimge.size.height*0.9, lashengimge.size.width*0.9, lashengimge.size.height*0.9, lashengimge.size.width*0.9)];
//    imagView.image = lashengimge;
//
//
//    imagView.userInteractionEnabled = YES;
//    [self.blueView addSubview:imagView];
//
//    UIButton *messagesBut = [UIButton buttonWithType:UIButtonTypeCustom];
//    [messagesBut setBackgroundImage:[UIImage imageNamed:@"personal_messages"] forState:UIControlStateNormal];
//    [messagesBut addTarget:self action:@selector(messagesTap) forControlEvents:UIControlEventTouchUpInside];
//    messagesBut.frame = CGRectMake(kScreenW-15-21, StatusBarHeight+7, 21, 16);
//    messagesBut.hidden = YES;
//    [self.blueView addSubview:messagesBut];
//
//    self.touxiangimageView = [[UIImageView alloc]initWithFrame:CGRectMake(17, 30+StatusBarHeight, 60,60)];
// //    self.touxiangimageView.image = [UIImage imageNamed:@"personal_bg"];
//   // self.touxiangimageView.backgroundColor = [UIColor redColor];
//    self.touxiangimageView.image = [UIImage imageNamed:@"morenTuPenson_ico"];
//    self.touxiangimageView.layer.cornerRadius  = 29;
//    self.touxiangimageView.layer.masksToBounds = YES;
//    self.touxiangimageView.userInteractionEnabled = YES;
//    self.touxiangimageView.layer.borderWidth = 2;
//    self.touxiangimageView.layer.borderColor = RGB(178, 208, 255).CGColor;
//
//    UITapGestureRecognizer *tapic11 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(gerenzhongXingTaP)];
//    [self.touxiangimageView addGestureRecognizer:tapic11];
//    [self.blueView addSubview:self.touxiangimageView];
//
//    self.mingchenglabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.touxiangimageView.right+13, self.touxiangimageView.top+10+3, 40, 12)];
//    self.mingchenglabel.text = @"未登录";
//    self.mingchenglabel.font = [UIFont systemFontOfSize:12];
//    self.mingchenglabel.textColor = [UIColor whiteColor];
// //   self.mingchenglabel.backgroundColor = [UIColor redColor];
//    [self.blueView addSubview:self.mingchenglabel];
//
//    UIImageView *zuanimageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.mingchenglabel.right+6, self.touxiangimageView.top+10+3, 16, 14)];
//    zuanimageView.image = [UIImage imageNamed:@"personal_vip"];
//    self.zuanimageView = zuanimageView;
//    [self.blueView addSubview:zuanimageView];
//
//
//
//
//
//    self.gerenzhongxinglabel = [[UILabel alloc]initWithFrame:CGRectMake(self.touxiangimageView.right+13, self.mingchenglabel.bottom+5, 70, 16)];
//    self.gerenzhongxinglabel.textColor = [UIColor whiteColor];
//    self.gerenzhongxinglabel.text = @"个人中心";
//    self.gerenzhongxinglabel.font = [UIFont systemFontOfSize:10];
//  //  self.gerenzhongxinglabel.backgroundColor = RGB(54, 141, 255);
//    self.gerenzhongxinglabel.layer.cornerRadius = 8;
//    self.gerenzhongxinglabel.layer.masksToBounds = YES;
//    self.gerenzhongxinglabel.textAlignment =  NSTextAlignmentCenter;
//   // self.gerenzhongxinglabel.alpha = 0.1;
//    self.gerenzhongxinglabel.userInteractionEnabled = YES;
//
//    self.gerenzhongxinglabel.backgroundColor = QCchunseshensetupian;
//
//    [self.blueView addSubview: self.gerenzhongxinglabel];
//
//    UITapGestureRecognizer *gerenzhongtap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(gerenzhongXingTaP)];
//    [self.gerenzhongxinglabel addGestureRecognizer:gerenzhongtap];
//
//    // 这个是关注 评论 等和 数字 的Uiview
//    UIView *commentsFuview = [[UIView alloc]initWithFrame:CGRectMake(15,  self.touxiangimageView.bottom+16, kScreenW-30, 34)];
//    self.commentsFuview = commentsFuview;
//    commentsFuview.hidden = YES;
//   // commentsFuview.backgroundColor = [UIColor redColor];
//    [self.blueView addSubview:commentsFuview];
//
//    CGFloat kuandu = commentsFuview.frame.size.width/4;
//    self.guanZpinglunMuArr = [[NSMutableArray alloc]init];
//
//    for (int i = 0; i < self.focusArray.count; i++) {
//
//        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(i*kuandu, 0, kuandu, 34)];
//
//        [commentsFuview addSubview:view];
//
//        UILabel *shulianlabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, kuandu, 13)];
//        shulianlabel.textColor = [UIColor whiteColor];
//        shulianlabel.text = @"0";
//      //  shulianlabel.backgroundColor = [UIColor orangeColor];
//        shulianlabel.font = [UIFont systemFontOfSize:13];
//        shulianlabel.textAlignment = NSTextAlignmentCenter;
//        [self.guanZpinglunMuArr addObject:shulianlabel];
//        [view addSubview:shulianlabel];
//
//
//
//
//
//        UILabel *guanzhulabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 21, kuandu, 13)];
//        guanzhulabel.textColor = [UIColor whiteColor];
//        guanzhulabel.text = self.focusArray[i];
//      //  guanzhulabel.backgroundColor = [UIColor orangeColor];
//        guanzhulabel.font = [UIFont systemFontOfSize:12];
//        guanzhulabel.textAlignment = NSTextAlignmentCenter;
//        [view addSubview:guanzhulabel];
//
//        if (i != 0 ) {
//            UIView *fengexiaView = [[UIView alloc]initWithFrame:CGRectMake(i*kuandu, 9, 1, 15)];
//            fengexiaView.backgroundColor = [UIColor whiteColor];
//            [commentsFuview addSubview:fengexiaView];
//
//        }
//
//
//
//
//
//    }
//
//
//
//
//
//
//
//}
//
//
//// 添加会员 余额  平台币
//- (void)addMembersOrBalance {
//
//    self.memberView  = [[HWMembersView alloc]initWithFrame:CGRectMake(15,self.commentsFuview.bottom+10, kScreenW-30, 100)];
//    self.memberView.backgroundColor = [UIColor whiteColor];
//    self.memberView.layer.shadowColor = [UIColor colorWithRed:113/255.0 green:152/255.0 blue:255/255.0 alpha:0.49].CGColor;
//    self.memberView.layer.shadowOffset = CGSizeMake(0,0);
//    self.memberView.layer.shadowOpacity = 1;
//    self.memberView.layer.shadowRadius = 12;
//    self.memberView.layer.cornerRadius = 12;
//    self.memberView.layer.masksToBounds = YES;
//    self.memberView.clipsToBounds = NO;
//    self.memberView.delegate = self;
//    [self.hederView addSubview: self.memberView];
//
//
//
//
//
//}
//
//
//
//-(void)addLibaoView {
//
//    self.libaoView  = [[HWLiBaoView alloc]initWithFrame:CGRectMake(15,self.memberView.bottom+18, kScreenW-30, 166)];
//    self.libaoView.backgroundColor = [UIColor whiteColor];
//    self.libaoView.layer.shadowColor = [UIColor colorWithRed:113/255.0 green:152/255.0 blue:255/255.0 alpha:0.49].CGColor;
//    self.libaoView.layer.shadowOffset = CGSizeMake(0,0);
//    self.libaoView.layer.shadowOpacity = 1;
//    self.libaoView.layer.shadowRadius = 12;
//    self.libaoView.layer.cornerRadius = 12;
//    self.libaoView.layer.masksToBounds = YES;
//    self.libaoView.delegate = self;
//    self.libaoView.clipsToBounds = NO;
//    [self.hederView addSubview:self.libaoView];
//
//}
//
//
//
//
//
//
//
//
//
//#pragma mark ------ UITableViewDelegate
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//
//    return  0;
//}
//
//
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//
//    UITableViewCell *cell = [[UITableViewCell alloc]init];
//    return  cell;
//}
//
//
//
//
//
//
//#pragma  mark ----- 一些点击操作
//
//
//// 点击右上脚个人中心
//- (void)messagesTap {
//
//    DLog(@"11111");
//
//
//}
//
//
//#pragma mark -----------  点击个人中心
//-  (void)gerenzhongXingTaP {
//
//    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//          HWLoginController  *login = [[HWLoginController alloc]init];
//            [self.navigationController pushViewController:login animated:YES];
//           return;
//
//    }
//    HWPersonalDataViewController *personData = [[HWPersonalDataViewController alloc]init];
//    [self.navigationController pushViewController:personData animated:YES];
//
//
//}
//
//
//// 用户中心
//- (void)chaxunUserCenter {
//
//
//    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//
////        HWLoginController *login = [[HWLoginController alloc]init];
////        [self.navigationController pushViewController:login animated:YES];
//        [self weidengluqingqiu];
//
//        return ;
//
//    }
//
//    NSString *userID = [HWLocallyStoredData getLoginUserID];
//    NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
//    NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
//    NSString *signMD5 = [WMUtil md5HexDigest:sign];
//
//
//
//
//
//    NSDictionary *parametes = @{
//                                @"ct" :  @"app",
//                                @"ac" : @"account",
//                                @"ios" : @"1",
//                                @"uid" :userID,
//                                @"t" :tStr,
//                                @"sign": signMD5
//                                };
//
//
//
//
//    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
//
//
//        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//     //   [MBProgressHUD hideHUD];
//
//
//        if ([codeStr intValue] == 1) {
//
//          //  self.fenleiMuArr = [response[@"data"] mutableCopy];
//          //  [MBProgressHUD  showError:@"加载失败"];
//            self.userDic = response[@"data"][@"user"];
//
//            NSURL *url = [NSURL URLWithString: self.userDic[@"face"]];
//            [self.touxiangimageView sd_setImageWithURL:url placeholderImage:nil];
//
//
//            NSString  *pet_name = self.userDic[@"pet_name"];
//
//             CGSize size  =   [WMUtil getWidthByString:pet_name withFont:[UIFont systemFontOfSize:12]  withStringSize:CGSizeMake(1000, 1000)];
//
//
//
//            self.mingchenglabel.frame =  CGRectMake(self.touxiangimageView.right+13, self.touxiangimageView.top+10+3, size.width, 12);
//            self.mingchenglabel.text = pet_name;
//
//            // self.zuanimageView
//
//             NSURL *url1 = [NSURL URLWithString:self.userDic[@"vip"]];
//             self.zuanimageView.frame =    CGRectMake(self.mingchenglabel.right+6, self.touxiangimageView.top+10+3, 16, 14);
//             [self.zuanimageView sd_setImageWithURL:url1 placeholderImage:nil];
//
//            NSArray *guanzxhu = @[self.userDic[@"guanzhu"],self.userDic[@"pinglun"],self.userDic[@"faquan"],self.userDic[@"fans"]];
//
//            for (int i = 0 ; i < self.guanZpinglunMuArr.count; i++) {
//
//                UILabel *labe  = self.guanZpinglunMuArr[i];
//                labe.text = [NSString stringWithFormat:@"%@",guanzxhu[i]];
//
//            }
//
//            self.memberView.dataDic = self.userDic;
//            self.kapianArr = response[@"data"][@"nav"];
//
//            self.libaoView.dataArr =  self.kapianArr;
//
//
//
//
//        } else {
//
//             [MBProgressHUD  showError:@"加载失败"];
//
//        }
//        NSLog(@"%@",response);
//
//
//    } failure:^(NSString *error) {
//
//        [MBProgressHUD  showError:@"加载失败"];
//
//    }];
//
//
//
//}
//
//
//
//
//// 未登录请求
//- (void)weidengluqingqiu {
//
//
//
//        NSString *userID = [HWLocallyStoredData getLoginUserID];
//        NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
//        NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
//        NSString *signMD5 = [WMUtil md5HexDigest:sign];
//
//
//
//
//        NSDictionary *parametes = @{
//                                    @"ct" :  @"app",
//                                    @"ac" : @"account",
//                                    @"ios" : @"1",
//                                    @"t" :tStr
//                                    };
//
//
//
//        [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
//
//
//            NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//         //   [MBProgressHUD hideHUD];
//
//
//            if ([codeStr intValue] == 1) {
//
//              //  self.fenleiMuArr = [response[@"data"] mutableCopy];
//              //  [MBProgressHUD  showError:@"加载失败"];
////                self.userDic = response[@"data"][@"user"];
////
////                NSURL *url = [NSURL URLWithString: self.userDic[@"face"]];
////                [self.touxiangimageView sd_setImageWithURL:url placeholderImage:nil];
////
////
////                NSString  *pet_name = self.userDic[@"pet_name"];
////
////                 CGSize size  =   [WMUtil getWidthByString:pet_name withFont:[UIFont systemFontOfSize:12]  withStringSize:CGSizeMake(1000, 1000)];
////
////
////
////                self.mingchenglabel.frame =  CGRectMake(self.touxiangimageView.right+13, self.touxiangimageView.top+10+3, size.width, 12);
////                self.mingchenglabel.text = pet_name;
////
////                // self.zuanimageView
////
////                 NSURL *url1 = [NSURL URLWithString:self.userDic[@"vip"]];
////                 self.zuanimageView.frame =    CGRectMake(self.mingchenglabel.right+6, self.touxiangimageView.top+10+3, 16, 14);
////                 [self.zuanimageView sd_setImageWithURL:url1 placeholderImage:nil];
////
////                NSArray *guanzxhu = @[self.userDic[@"guanzhu"],self.userDic[@"pinglun"],self.userDic[@"faquan"],self.userDic[@"fans"]];
////
////                for (int i = 0 ; i < self.guanZpinglunMuArr.count; i++) {
////
////                    UILabel *labe  = self.guanZpinglunMuArr[i];
////                    labe.text = [NSString stringWithFormat:@"%@",guanzxhu[i]];
////
////                }
//
////                self.memberView.dataDic = self.userDic;
////
//                self.memberView.weidengluoArr = @[@"0.00",@"0.00",@"0.00"];
//
//                 self.mingchenglabel.text = @"未登录";
//                 self.touxiangimageView.image = [UIImage imageNamed:@"acat"];
//
//
//
//
//
//                self.kapianArr = response[@"data"][@"nav"];
//
//                self.libaoView.dataArr =  self.kapianArr;
//
//
//
//
//            } else {
//
//                 [MBProgressHUD  showError:@"加载失败"];
//
//            }
//            NSLog(@"%@",response);
//
//
//        } failure:^(NSString *error) {
//
//            [MBProgressHUD  showError:@"加载失败"];
//
//        }];
//
//
//
//
//
//}
//
//
//
//
//
//
//
//#pragma mark ------------ 礼包中的东西
//
//- (void)xuanzhongDic:(NSDictionary *)xuanzhng {
//
//    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//            HWLoginController  *login = [[HWLoginController alloc]init];
//              [self.navigationController pushViewController:login animated:YES];
//             return;
//
//    }
//
//    NSString *urlStr = xuanzhng[@"url"];
//
//    if (![urlStr isEqualToString:@""]) {
//            XMGWebViewController *webVc = [[XMGWebViewController alloc] init];
//            webVc.url = [NSURL URLWithString:urlStr];
//            [self.navigationController pushViewController:webVc animated:YES];
//
//        return;
//    }
//
//
//
//
//
//    NSString *str = xuanzhng[@"name"];
//    if ([str isEqualToString:@"我的礼包"]) {
//
//        HWMyGiftBagViewController *MyGiftBag = [[HWMyGiftBagViewController alloc]init];
//        [self.navigationController pushViewController:MyGiftBag animated:YES];
//
//    } else if ([str isEqualToString:@"我的收藏"]) {
//
//        HWCollectionViewController *CollectionView =[[HWCollectionViewController alloc]init];
//        [self.navigationController pushViewController:CollectionView animated:YES];
//
//
//    } else if ([str isEqualToString:@"我的帐单"]) {
//
////        HWMyDetailViewController  *detail = [[HWMyDetailViewController alloc]init];
////        [self.navigationController pushViewController:detail animated:YES];
//
////        HWIntegralSubsidiaryViewController *IntegralSubsidiary = [[HWIntegralSubsidiaryViewController alloc]init];
////        [self.navigationController pushViewController:IntegralSubsidiary animated:YES];
////
//        // HWMyzhangdangQCViewController
//
//        HWMyzhangdangQCViewController *IntegralSubsidiary = [[HWMyzhangdangQCViewController alloc]init];
//            [self.navigationController pushViewController:IntegralSubsidiary animated:YES];
//
//
//    }else if ([str isEqualToString:@"我的绑币"]) {
//
//
//        HWMyCurrencyViewController *bangbi = [[HWMyCurrencyViewController alloc]init];
//        [self.navigationController pushViewController:bangbi animated:YES];
//
//
//    } else if ([str isEqualToString:@"小号管理"] ) {
//
//
////           HWRetunTrumpetViewController  *trumpet = [[HWRetunTrumpetViewController alloc]init];
////           [self.navigationController pushViewController:trumpet animated:YES];
//        HWsXiaoHaoGuanLiViewController *xiaoHao = [[HWsXiaoHaoGuanLiViewController alloc]init];
//        [self.navigationController pushViewController:xiaoHao animated:YES];
//
//
//
//
//    } else if ([str isEqualToString:@"设置中心"] ) {
//
//        HWSetZhongXingViewController *setZhongXing  = [[HWSetZhongXingViewController alloc]init];
//        [self.navigationController pushViewController:setZhongXing animated:YES];
//
//
//    } else if ([str isEqualToString:@"帐号安全"]) {
//
//        HWAccountSecurityController *acount  = [[HWAccountSecurityController alloc]init];
//        [self.navigationController pushViewController:acount animated:YES];
//
//    } else if ([str isEqualToString:@"联系客服"]) {
//
//
////        HWCustomerServiceCenterViewController *customerService = [[HWCustomerServiceCenterViewController alloc]init];
////        [self.navigationController pushViewController:customerService animated:YES];
//
//
//    }
//
//}
//
//
//
//
//
//-(void)xuanzhongTap:(NSInteger)tag {
//
//
//    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//          HWLoginController  *login = [[HWLoginController alloc]init];
//            [self.navigationController pushViewController:login animated:YES];
//           return;
//
//     }
//     if (tag == 0) {
//        HWMyGiftBagViewController *MyGiftBag = [[HWMyGiftBagViewController alloc]init];
//           [self.navigationController pushViewController:MyGiftBag animated:YES];
//
//     } else if (tag == 1) {
//
//        HWMyFocusViewController *MyFocus = [[HWMyFocusViewController  alloc]init];
//        [self.navigationController pushViewController:MyFocus animated:YES];
//
//
//
//      } else if (tag == 2) {
//          HWCollectionViewController *CollectionView =[[HWCollectionViewController alloc]init];
//          [self.navigationController pushViewController:CollectionView animated:YES];
//
//
//
//
//      } else if (tag == 3) {
//
//        HWMyDetailViewController  *detail = [[HWMyDetailViewController alloc]init];
//        [self.navigationController pushViewController:detail animated:YES];
//
//    } else if ( tag ==4) {
//
////        HWTrumpetManagementViewController  *trumpet = [[HWTrumpetManagementViewController alloc]init];
////        [self.navigationController pushViewController:trumpet animated:YES];
//
////        HWRetunTrumpetViewController  *trumpet = [[HWRetunTrumpetViewController alloc]init];
////        [self.navigationController pushViewController:trumpet animated:YES];
//
//    } else if (tag == 5) {
//
//        HWRetunTrumpetViewController  *trumpet = [[HWRetunTrumpetViewController alloc]init];
//        [self.navigationController pushViewController:trumpet animated:YES];
//
//
//    } else if (tag == 6) {
//
//        HWSetZhongXingViewController *setZhongXing  = [[HWSetZhongXingViewController alloc]init];
//        [self.navigationController pushViewController:setZhongXing animated:YES];
//
//
//    }  else if (tag == 7) {
//
//        HWAccountSecurityController *acount  = [[HWAccountSecurityController alloc]init];
//        [self.navigationController pushViewController:acount animated:YES];
//
//    }
//
//
//
//
//
//
//
//}
//
//
//
//#pragma mark -------- 会员中心 和 申请返利
//
//-(void)HWMembersViewXuZhongTap:(NSInteger)tag {
//
//
//
//    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//        HWLoginController  *login = [[HWLoginController alloc]init];
//          [self.navigationController pushViewController:login animated:YES];
//          return;
//
//    }
//
//    if (tag == 0) {
//
////          HWMembersCenterViewController  *members = [[HWMembersCenterViewController alloc]init];
////         [self.navigationController pushViewController:members animated:YES];
//
//        HWIntegralSubsidiaryViewController *IntegralSubsid = [[HWIntegralSubsidiaryViewController alloc]init];
//        [self.navigationController pushViewController:IntegralSubsid animated:YES];
//
//
//      } else if (tag == 1) {
//
//
////          HWMyAmountViewController *MyAmount = [[HWMyAmountViewController alloc]init];
////          [self.navigationController pushViewController:MyAmount animated:YES];
//
//          HWMyCurrencyViewController *bangbi = [[HWMyCurrencyViewController alloc]init];
//          [self.navigationController pushViewController:bangbi animated:YES];
//
//
//
//      }else if (tag == 2) {
////
////          [MBProgressHUD showError:@"此功能暂未开通"];
////          return;
////          HWMyFlatViewController  *MyFlat = [[HWMyFlatViewController alloc]init];
////          [self.navigationController pushViewController:MyFlat animated:YES];
////
//          HWWebViewTopUpController  *web = [[HWWebViewTopUpController alloc]init];
//          [self.navigationController pushViewController:web animated:YES];
//
//
//
//
//      }
//
//
//
// //   return;
////
////    if (tag == 0) {
////
////        HWMembersCenterViewController  *members = [[HWMembersCenterViewController alloc]init];
////       [self.navigationController pushViewController:members animated:YES];
////
////
////    } else if (tag == 1) {
////
////
////        HWMyAmountViewController *MyAmount = [[HWMyAmountViewController alloc]init];
////        [self.navigationController pushViewController:MyAmount animated:YES];
////
////
////    }else if (tag == 2) {
////
////        HWMyFlatViewController  *MyFlat = [[HWMyFlatViewController alloc]init];
////        [self.navigationController pushViewController:MyFlat animated:YES];
////
////
////    }
//
//
//
//}
//
//
//
//
//@end



